package com.haruhinav.controller.admin;


import com.haruhinav.entity.EmailDetails;
import com.haruhinav.entity.YiBanRemindPunch;
import com.haruhinav.entity.vo.ResultVO;
import com.haruhinav.service.YiBanRemindPunchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;

@RestController
@RequestMapping("/api/admin/yb")
public class AdminYiBanRemindPunchController {


    @Autowired
    YiBanRemindPunchService yiBanRemindPunchService;


    @GetMapping("/y/email-etails")
    public ResultVO getEmailDetails(){
        return yiBanRemindPunchService.getEmailDetails();
    }
    @GetMapping("/y/user-list")
    public ResultVO queryUser(YiBanRemindPunch yibanUser){
        return yiBanRemindPunchService.queryYiBanRemindPunch(yibanUser);
    }

    @PostMapping("/y/update-emailDetails")
    public ResultVO updateEmailDetails(@RequestBody EmailDetails emailDetails){
        return yiBanRemindPunchService.updateEmailDetails(emailDetails);
    }

    @PostMapping("/y/add-ybuser")
    public ResultVO addYiBanUser(@RequestBody YiBanRemindPunch yiBanRemindPunch){
        return yiBanRemindPunchService.addYiBanUser(yiBanRemindPunch);
    }
    @PostMapping("/y/update-ybuser")
    public ResultVO updateYiBanUser(@RequestBody YiBanRemindPunch yiBanRemindPunch){
        return yiBanRemindPunchService.updateYiBanUser(yiBanRemindPunch);
    }
    @PostMapping("/y/remove-ybuser")
    public ResultVO removeYiBanUser(@RequestBody YiBanRemindPunch yiBanRemindPunch){
        return yiBanRemindPunchService.removeYiBanUser(yiBanRemindPunch.getId());
    }

    @GetMapping("/y/user/{id}")
    public ResultVO dfgd(@PathVariable("id") Integer id){
        return yiBanRemindPunchService.findUserById(id);
    }
}
